﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace shop.Model
{

    public class CostModel
    {
        private string _receiver_prov;

        public string trade_no { set; get; }

        public string shop_name { set; get; }

        public string warehouse { set; get; }

        public string src_tids { set; get; }


        public string receiver_district { set; get; }


        public string logistics_name { set; get; }

        public string logistics_no { set; get; }

        public string cs_remark { set; get; }

        public string remark { set; get; }

        public string cs_flag { set; get; }

        public string spec_no { set; get; }

        public string goods_no { set; get; }

        public string goods_name { set; get; }

        public string spec_name { set; get; }

        public string api_goods_name { set; get; }

        public string api_spec_name { set; get; }

        public decimal num { set; get; }

        public decimal actual_num { set; get; }

        public string platform_goods_id { set; get; }

        public string platform_spec_id { set; get; }

        /// <summary> 发货时间 </summary>
        public DateTime consign_time { set; get; }

        /// <summary> 成本 </summary>
        public decimal goodsPrice { set; get; }

        /// <summary> 体积 </summary>
        public decimal Volume { set; get; }

        /// <summary> 计算油费用的重量 </summary>
        public decimal fWeight { set; get; }

        /// <summary> 估算的 </summary>
        public decimal calc_post_cost { set; get; }

        public decimal paid { set; get; }


        public DateTime? payTime {  set; get; } 

        /// <summary> 返点 </summary>
        public decimal fandian { set; get; }

        public string receiver_prov
        {
            get => _receiver_prov;
            set
            {
                _receiver_prov = value;
                if (string.IsNullOrEmpty(_receiver_prov) == false && _receiver_prov.Length >= 2)
                {
                    provShort = _receiver_prov.Substring(0, 2);
                }
                else
                {
                    provShort= _receiver_prov ?? string.Empty;
                }
            }
        }

        public string provShort { set; get; }

        /// <summary> 城市 </summary>
        public string city { set; get; }

        /// <summary> 是否多把 </summary>
        public bool IsMult { set; get; }

        public decimal amountByNum { get; set; }
        public decimal amountByWei { get; set; }

        /// <summary> 是否代发 </summary>
        public bool isAgent { set; get; }

        /// <summary> 刷单费用 </summary>
        public decimal shuadan { set; get; }

        /// <summary> 代发加收 </summary>
        public decimal DaifaAdd { get; set; }

        public string fenxiao { get; set; }


        /// <summary> 来源组合装编码 </summary>
        public string suite_no { get; set; }

        public decimal from_assembly_qty { set; get; }

        public string trade_type { set; get; }

        /// <summary>  </summary>
        public decimal calc_num { get;  set; }

        /// <summary> 计算运费单价用的相同货品(相同快递单号)的累计数量,  </summary>
        public decimal calc_post_num { get; set; }


        /// <summary> 计算成本改单价用的相同货品(相同快递单号)的累计数量, 多把的需要乘以倍数  </summary>
        public decimal calc_cost_num { get; set; }

        /// <summary> 计算金额的数量 </summary>
        public decimal calc_cost_num2 { get; set; }

        public string logiAcct { get; set; }

        /// <summary> 利润 </summary>
        public decimal Profit { get; set; }


        /// <summary> 利润占比 </summary>
        public decimal ProfitRatio { get; set; }

        public string Operator { get; set; }


        public string ShopPerson { get; set; }


        /// <summary> 所属多把信息 </summary>
        [JsonIgnore]
        public MultPostPrice Mu { get; set; }


        public decimal CostAmount { get; set; }

        /// <summary> 计提退款+补件+退款成功的利润（销售额的0.0336）   </summary>
        public decimal OtherCost{ get; set; }


        /// <summary> 扣款后的成本金额 </summary>
        public decimal CostAmountRefund { set; get; }

        /// <summary> 扣款后的支付金额 </summary>
        public decimal PayAmountRefund { set; get; }


        /// <summary> 退款编号 </summary>
        public string RefundNo { get; set; }


        /// <summary> 退款金额 </summary>
        public decimal RefundAmount { set; get; }

    }
}
